var express = require('express')
var path = require('path')
var router = require('./router')
var bodyParser = require('body-parser')
var session = require('express-session')
var app = express()
app.use('/public', express.static(path.join(__dirname, './public'))) //把相对路径改为绝对路径
app.use('/node_modules', express.static(path.join(__dirname, './node_modules')))
app.engine('html', require('express-art-template'))
app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())
app.use(session({
    secret: 'keyboard cat',
    resave: false,
    saveUninitialized: true,
    
}))
app.use(router)
app.listen(8000)

